import string;

class En_Formatter(object):
    
    @staticmethod
    def dealWithSpaces(term):
        newTerm = '';
        for char in term:
            if(char == ' '):
                char = '_';
            newTerm = newTerm + char;
        return newTerm;
    
    @staticmethod
    def stripClitic(term):
        if(term.endswith("'S")):
            return term[:len(term) - 2];
        else: return term;
    
    @staticmethod
    def formatRawInput(term):
        newTerm = En_Formatter.stripClitic(term);
        newTerm = En_Formatter.dealWithSpaces(newTerm);
        newTerm = string.capwords(newTerm, '_');
        return newTerm;
    
    @staticmethod
    def termConcat(termA, termB):
        return termA + "_" + termB;